void function(){

    var app = angular.module('s1.app',['ui.router']);
    app.config(function($stateProvider,$urlRouterProvider){
        $urlRouterProvider.otherwise('/opp_a');
        $stateProvider
            //html笔记
            .state('html5_a',{
                url:'/html5_a',
                templateUrl:'html/html5_a.html'
            })
            .state('html5_b',{
                url:'/html5_b',
                templateUrl:'html/html5_b.html'
            })
            .state('html5_c',{
                url:'/html5_c',
                templateUrl:'html/html5_c.html'
            })
            //javascript笔记
            .state('javascript_b',{
                url:'/javascript_b',
                templateUrl:'javascript_book/javascript_b.html'
            })
            .state('javascript_s',{
                url:'/javascript_s',
                templateUrl:'javascript_book/javascript_s.html'
            })
            .state('javascript_z',{
                url:'/javascript_z',
                templateUrl:'javascript_book/javascript_z.html'
            })
            //jQuery笔记
            .state('jQuery_a',{
                url:'/jQuery_a',
                templateUrl:'jQuery_book/jQuery_a.html'
            })
            .state('jQuery_b',{
                url:'/jQuery_b',
                templateUrl:'jQuery_book/jQuery_b.html'
            })
            .state('jQuery_c',{
                url:'/jQuery_c',
                templateUrl:'jQuery_book/jQuery_c.html'
            })
            .state('Canvas_a',{
                url:'/Canvas_a',
                templateUrl:'Canvas_book/Canvas_a.html'
            })
            .state('Canvas_b',{
                url:'/Canvas_b',
                templateUrl:'Canvas_book/Canvas_b.html'
            })
            .state('Canvas_c',{
                url:'/Canvas_c',
                templateUrl:'Canvas_book/Canvas_c.html'
            })
            //面向对象笔记
            .state('opp_a',{
                url:'/opp_a',
                templateUrl:'oop/opp_a.html'
            })
            .state('opp_b',{
                url:'/opp_b',
                templateUrl:'oop/opp_b.html'
            })
            .state('opp_c',{
                url:'/opp_c',
                templateUrl:'oop/opp_c.html'
            })
            .state('opp_d',{
                url:'/opp_d',
                templateUrl:'oop/opp_d.html'
            })
            .state('opp_e',{
                url:'/opp_e',
                templateUrl:'oop/opp_e.html'
            })
            .state('opp_f',{
                url:'/opp_f',
                templateUrl:'oop/opp_f.html'
            })
           //ES
            .state('es5_a',{
                url:'/es5_a',
                templateUrl:'es/es5_a.html'
            })
            .state('es6_a',{
                url:'/es6_a',
                templateUrl:'es/es6_a.html'
            })
          //框架处理
            .state('kj_a',{
                url:'/kj_a',
                templateUrl:'kj_book/kj_a.html'
            })
            .state('kj_b',{
                url:'/kj_b',
                templateUrl:'kj_book/kj_b.html'
            })

    })
}();

$(function(){
    $(".toc-item").on("click",function(e){
        e.preventDefault();
        $(document.body).animate({scrollTop: 0}, 1);
    });

    //笔记菜单
    var areas = $("#web-note-book").find(".area");
    var collapses = $("#web-note-book").find(".collapse");
    for(var i = 0; i < areas.length; i++){
        var area = $(areas[i]);
        area.on("click",function(){
                for(var j = 0; j < areas.length; j++){
                    $(areas[j]).removeClass("active");
                    $(areas[j]).removeClass("collapsed");
                    $(collapses[j]).removeClass("in");

                }
            $(this).addClass("active");
            $(this).addClass("collapsed");
            $(this).next("ul").slideToggle(400).addClass("in")
        })
    }

    //添加轮播span
    var liSpan = "<li><span></span><span></span><span></span><span></span><span></span><span></span></li>";
    var str = "";
    var arrStr = [];
    for(var i = 1; i <=50; i++){
        arrStr.push(liSpan);
    }
    str = arrStr.join("");
    $("#slideSpan").append(str);
    console.log();


    //3D轮播
    var now = 0;
   function playSlide(){
       now++;
       $("#threeDSlide li").css('transform','rotateX(' + now*60 + 'deg)').each(function(index){
           $(this).css('transition-delay',index*0.10 + 's');
       });
   }

    $("#prev").on("click",playSlide);

    $("#next").on("click",function(){
        now--;
        $("#threeDSlide li").css('transform','rotateX(' + now*60 + 'deg)').each(function(index){
            $(this).css('transition-delay',index*0.10 + 's');
        });
    });
    playSlide();
    setInterval(function(){
        playSlide();
    },10000)
})